<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>p2_元素消失方式</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            border: 5px solid #000;
        }
        .d1 {background-color: #f00; transition: 2s;}
        .d1:hover {
            transform: rotate(180deg) scale(0);/*缩小到看不见 不释放布局空间*/
        }
        .d2 {background-color: #0f0;}
        .d2:hover {
            display: none;/*修改显示模式 会释放布局空间*/
        }
        .d3 {background-color: #00f;}
        .d3:hover {
            background-color: rgba(255,255,255,0);/*修改背景色为透明 但注意若有边框则会留下边框 */
        }
    </style>
</head>
<body>
    <!--.d*3-->
    <div class="d1"></div>
    <div class="d2"></div>
    <div class="d3"></div>
</body>
</html>